package com.example.callcenter.util;

import lombok.Data;

@Data
public class ResultUtil {
    private int code;
    private String msg;
    private Object data;

    public static ResultUtil success(Object data) {
        ResultUtil result = new ResultUtil();
        result.setCode(200);
        result.setMsg("操作成功");
        result.setData(data);
        return result;
    }

    public static ResultUtil error(String msg) {
        ResultUtil result = new ResultUtil();
        result.setCode(500);
        result.setMsg(msg);
        return result;
    }
}